#include <stdio.h>

int main(void)
{
    int line;   //declare will printed lines

    printf("please input a number (<100):\n");
    int scan_temp;
    while ((scan_temp = scanf("%d", &line)) != 1)   //get ONE number
    {
        while (getchar() != '\n') //flash the character buffer
        {
            continue;
        }

        if (line > 100 || line < 0)
        {
            printf("Too large or Too small!\n");
            printf("please input a number (<100):\n");
            continue;
        }
        if (line % 2 == 0)
        {
            printf("INVALID number!\n");
            printf("please input a number (<100):\n");
            continue;
        }
        break;
    }

    for (int i = 0; i < line / 2; i++)
    {

        for (int j = 0; j < line / 2 - i; j++)
        {
            printf(" ");
        }
        for (int j = 0; j < i + 1; j++)
        {
            printf("*");
        }
        for (int j = 0; j < i; j++)
        {
            printf("*");
        }
        for (int j = 0; j < line / 2 - i; j++)
        {
            printf(" ");
        }

        printf("\n");
    }

    for (int i = 1; i < line / 2; i++)
    {

        for (int j = 0; j < i + 1; j++)
        {
            printf(" ");
        }
        for (int j = 0; j < line / 2 - i - 1; j++)
        {
            printf("*");
        }
        for (int j = 0; j < line / 2 - i; j++)
        {
            printf("*");
        }
        for (int j = 0; j < i + 1; j++)
        {
            printf(" ");
        }

        printf("\n");
    }
    return 0;
}
